#!/bin/bash


# 获取spec版本号
ct_getSpecFileVersion() {
	fileName=$1
	
	cat ${fileName} | while read line
	do
		array=(${line//=/ })
		
		if [[ ${#array[@]} == 2 ]]; then
			if [[ ${array[0]} == *".version" ]];  then
				echo ${array[1]} |sed 's/\"//g' # 去除两端的双引号
				break;
			fi
		fi
	done
}

# 获取本地私有仓库的目录
# 使用示例：
# 		ret="$(ct_getPrivateSpecsFolder)"
# 		if [ ${#ret} == 0 ]; then exit 0; fi
ct_getPrivateSpecsFolder() {
	tmp_folders=("creatoo" "andney" "gitee-andney-pod-specs" "pod-specs")
	for item in ${tmp_folders[*]}; do
		a="${HOME}/.cocoapods/repos/${item}/Specs"
		if [ -d "${a}" ]; then
			echo "${a}"
			break
		fi
	done;
}
